package za.ac.lance.singleresponsibilityprinciple.obeys.model;

/**
 * File Name: Calculator.java
 * Version:
 * Description:
 * Package: za.ac.lance.singleresponsibilityprinciple.obeys.model
 * Author: Lance
 * Date: Mar 2, 2012
 */
public class Calculator
{

    private int answer;
    private Converter converter = new Converter(0);

    public Calculator(int answer)
    {
        this.answer = answer;
    }

    public int Addition(int killos, int grams)
    {
        setAnswer(killos + converter.KilloToGrams(grams));
        return getAnswer();
    }

    public int Subtraction(int killos, int grams)
    {
        setAnswer(converter.GramsToKillo(grams) - grams);
        return getAnswer();
    }

    public int getAnswer()
    {
        return answer;
    }

    public void setAnswer(int answer)
    {
        this.answer = answer;
    }
}
